<?php
/**
 * Magento Enterprise Edition
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Magento Enterprise Edition End User License Agreement
 * that is bundled with this package in the file LICENSE_EE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.magento.com/license/enterprise-edition
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magento.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magento.com for more information.
 *
 * @category    design
 * @package     enterprise_default
 * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
 * @license http://www.magento.com/license/enterprise-edition
 */
?>
<?php
/**
 * @see Mage_Core_Block_Template
 */
?>
<div class="page-title">
    <h1><?php echo Mage::helper('enterprise_invitation')->__('Send Invitations') ?></h1>
</div>
<div id="messages"><?php echo $this->getMessagesBlock()->toHtml() ?></div>
<?php echo $this->getChildHtml('form_before')?>
<?php if ($maxPerSend = (int)Mage::helper('enterprise_invitation')->getMaxInvitationsPerSend()): ?>
<form id="invitationForm" action="" method="post">
    <div class="fieldset">
    <h2 class="legend"><?php echo Mage::helper('enterprise_invitation')->__('Invite your friends by entering their email addresses below'); ?></h2>
        <ul class="form-list">
            <?php $_perRow = ceil($maxPerSend/3); for($_index = 1; $_index <= $maxPerSend; $_index ++): ?>
            <li>
                <label for="email_<?php echo $_index ?>"<?php if ($_index == 1) echo ' class="required"' ?>><?php if ($_index == 1) echo '<em>*</em>' ?><?php echo $_index; ?>:</label>
                <div class="input-box">
                    <input tabindex="<?php echo $_index ?>" name="email[]" id="email_<?php echo $_index ?>" title="<?php echo Mage::helper('core')->quoteEscape(Mage::helper('enterprise_invitation')->__('Email')) ?>" value="" class="<?php if ($_index == 1): ?>required-entry <?php endif;?>input-text validate-email" type="text" />
                </div>
            </li>
            <?php endfor; ?>
        <?php if (Mage::helper('enterprise_invitation')->isInvitationMessageAllowed()): ?>
            <li>
                <label for="message"><?php echo Mage::helper('enterprise_invitation')->__('Message');?>: </label>
                <div class="input-box">
                    <textarea tabindex="<?php echo $_index+1 ?>" name="message" id="message" title="<?php echo Mage::helper('core')->quoteEscape(Mage::helper('enterprise_invitation')->__('Message')) ?>"  class="input-text" rows="5" cols="5"></textarea>
                </div>
            </li>
        </ul>
        <?php endif;?>
    </div>
   <p class="required"><?php echo Mage::helper('enterprise_invitation')->__('* Required Fields') ?></p>
    <div class="buttons-set form-buttons">
        <p class="back-link"><a href="<?php echo Mage::helper('enterprise_invitation')->getCustomerInvitationUrl() ?>"><small>&laquo; </small><?php  echo Mage::helper('enterprise_invitation')->__('Back to Invitations') ?></a></p>
        <button class="button" type="submit"><span><span><?php echo Mage::helper('enterprise_invitation')->__('Send Invitations') ?></span></span></button>
    </div>

</form>
<script type="text/javascript">
    var contactForm = new VarienForm('invitationForm', true);
</script>
<?php else:?>
<p><?php echo Mage::helper('enterprise_invitation')->__('You cannot send more invitations'); ?></p>
<?php endif; ?>
